home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
win_chil
/
main_for.frm
< prev
next >
Wrap
Text File
|
1995-09-06
|
11KB
|
376 lines
VERSION 2.00
Begin Form Main_Form
BackColor = &H00C0C0C0&
Caption = "WindChill Calculator"
ClientHeight = 3870
ClientLeft = 1290
ClientTop = 2205
ClientWidth = 7425
Height = 4560
Icon = MAIN_FOR.FRX:0000
Left = 1230
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3870
ScaleWidth = 7425
Top = 1575
Width = 7545
Begin CommandButton Command2
BackColor = &H00C0C0C0&
Caption = "Another"
Height = 495
Left = 3960
TabIndex = 12
Top = 3000
Width = 3255
End
Begin CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "Convert"
Default = -1 'True
Height = 495
Left = 3960
TabIndex = 11
Top = 2520
Width = 3255
End
Begin PictureBox Picture3
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 975
Left = 240
ScaleHeight = 975
ScaleWidth = 3375
TabIndex = 16
Top = 2520
Width = 3375
Begin Label Label9
Alignment = 2 'Center
BackColor = &H00C0C0C0&
ForeColor = &H00FF0000&
Height = 255
Left = 1800
TabIndex = 0
Top = 360
Width = 1455
End
Begin Label Label10
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "WindChill is =>"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 1575
End
End
Begin PictureBox Picture2
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 1815
Left = 3960
ScaleHeight = 1815
ScaleWidth = 3255
TabIndex = 13
Top = 360
Width = 3255
Begin Label Label8
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "Degrees Celcius"
Height = 255
Left = 1320
TabIndex = 2
Top = 1200
Width = 1815
End
Begin Label Label6
Alignment = 2 'Center
BackColor = &H00C0C0C0&
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 4
Top = 1200
Width = 1095
End
Begin Label Label7
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "Meters/Second"
Height = 255
Left = 1320
TabIndex = 3
Top = 600
Width = 1815
End
Begin Label Label5
Alignment = 2 'Center
BackColor = &H00C0C0C0&
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 5
Top = 600
Width = 1095
End
Begin Label Label4
BackColor = &H00C0C0C0&
Caption = "Conversion"
Height = 255
Left = 240
TabIndex = 15
Top = 120
Width = 1575
End
End
Begin PictureBox Picture1
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 1815
Left = 240
ScaleHeight = 1815
ScaleWidth = 3375
TabIndex = 8
Top = 360
Width = 3375
Begin TextBox Text2
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 10
Top = 1200
Width = 855
End
Begin TextBox Text1
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 9
Top = 600
Width = 855
End
Begin Label Label2
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "Temperature Degrees F."
Height = 255
Left = 1080
TabIndex = 6
Top = 1200
Width = 2175
End
Begin Label Label1
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = " Wind Speed MPH"
Height = 255
Left = 1080
TabIndex = 7
Top = 600
Width = 2175
End
Begin Label Label3
BackColor = &H00C0C0C0&
Caption = "Enter Here"
Height = 255
Left = 120
TabIndex = 14
Top = 120
Width = 1695
End
End
Begin Menu FileCmd
Caption = "&File"
Begin Menu AboutCmd
Caption = "About"
Shortcut = ^A
End
Begin Menu spacer
Caption = "-"
End
Begin Menu ExitCmd
Caption = "Exit"
Shortcut = ^E
End
End
Begin Menu HelpCmd
Caption = "&Help"
End
End
Sub AboutCmd_Click ()
about.Show
End Sub
Sub BorderBox (source1 As Control, source2 As Control)
bleft% = source1.Left - 45
btop% = source1.Top - 20
bwide% = source1.Width + 40
bhigh% = source1.Height + 15
source2.Line (bleft%, btop%)-Step(bwide%, 0), 0
source2.Line -Step(0, bhigh%), &HFFFFFF
source2.Line -Step(-bwide%, 0), &HFFFFFF
source2.Line -Step(0, -bhigh%), 0
End Sub
Sub BorderBoxRaised (source1 As Control, source2 As Form)
bleft% = source1.Left - 20
btop% = source1.Top - 20
bwide% = source1.Width + 15
bhigh% = source1.Height + 15
source2.Line (bleft%, btop%)-Step(bwide%, 0), &HFFFFFF
source2.Line -Step(0, bhigh%), 0
source2.Line -Step(-bwide%, 0), 0
source2.Line -Step(0, -bhigh%), &HFFFFFF
End Sub
Sub Command1_Click ()
Dim s#, t#, ms#, c#, wc#, a, b
msg$ = "You must enter both MPH and ░F"
title$ = "Entry Error"
s# = Val(text1.text)
t# = Val(text2.text)
If s# = 0 Or t# = 0 Then 'forgot to enter both numbers
MsgBox msg$, 64, title$
If s# = 0 Then text1.SetFocus
If t# = 0 Then text2.SetFocus
Exit Sub
End If
ms# = s# * .444 'convert to meters/second
c# = ((t# - 32) * 5 / 9)'convert to degrees Celcius
'MAIN WIND CHILL FORMULA
wc# = 1.8 * (33 - (((Sqr(100 * ms#) + 10.45 - ms#) * (33 - (t# - 32) * .55))) / 22.066) + 32
label5.caption = Format$(ms#, "##,###.00")
label6.caption = Format$(c#, "##,###.00")
label9.caption = Format$(wc#, "##,###.0") + " ░F"
End Sub
Sub Command2_Click ()
text1.text = ""
text2.text = ""